#define MAX_RING_NODES 	5
#define STRING_SIZE		1024
#define	SPACE ' '

typedef struct ring_node_t {
	int self_id;
	char IP[16];
	int port;
	int self_sid;
	int successor_sid;
	int leader_sid;
} ring_node;

typedef struct leader_t {
	int self_id;
	char IP[16];
	int port;
	int sid[MAX_RING_NODES];

} leader;

typedef struct config_info_t {
	int self_id;
	ring_node nodes[MAX_RING_NODES];
	int num_nodes;
	leader l;
	int num_proposers;
} config_info;

config_info *config_sample;
const char * config_file;

config_info * get_config_info();
int get_substr(int start_index, int end_index, char * source, char * result_to_return);
void create_ring(config_info *config);
void get_ip_port(const char* config_file, config_info * config, const char * match, char flag);
void parse_config_file(int self_id, const char * config_file_name, char am_i_leader, int num_proposers);
void connect_to_leader(config_info *config);

